<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="../cabecalho.jsp"%>
<script type="text/javascript" src="<c:url value='/'/>/js/gdl.js"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value='/'/>/js/interface.js"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value='/'/>/js/jquery-ui.js"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value='/'/>/js/dateFormat.js"></script>
<link href="<c:url value='/css/jquery-ui.css'/>" rel="stylesheet"
	type="text/css" />
<script type="text/javascript">
	jQuery(function($) {
		$("input.data").mask("99/99/9999", {
			placeholder : ""
		});
	});

	jQuery(function() {
		$(".column").sortable({
			connectWith : '.column',
			handle : $(".portlet-header")
		});

		$(".portlet").addClass(
				"ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
				.find(".portlet-header").addClass(
						"ui-widget-header ui-corner-all").prepend(
						'<span class="ui-icon ui-icon-minusthick"></span>')
				.end().find(".portlet-content");

		$(".portlet-header .ui-icon").click(
				function() {
					$(this).toggleClass("ui-icon-minusthick").toggleClass(
							"ui-icon-plusthick");
					$(this).parents(".portlet:first").find(".tabelaDiv")
							.toggle();
				});

	});
</script>

<%-- !-- Processo seletivo--%>
<div id="formProcessoSeletivo" class="form_cadastro">
	<form action="<c:url value='/processoSeletivo/cadastro'/>"
		method="post">

		<input type="hidden" name="processoSeletivo.processoSeletivoId"
			value="${processoSeletivo.processoSeletivoId}" maxlength=120 />

		<fieldset>
			<legend>
				<b><fmt:message key="cadastro_area_pesquisa_titulo_informacoes" />
				</b>
			</legend>

			<div class="row">

				<div class="label">
					<fmt:message key="processo_seletivo_descricao" />
				</div>
				<span class="formw"><input type="text"
					name="processoSeletivo.descricao"
					value="${processoSeletivo.descricao}" /> </span>

				<div class="label">
					<fmt:message key="data_abertura_insercao" />
				</div>
				<span class="formw"> <input class="data" type="text"
					style="width: 85px" name="processoSeletivo.dataDeAbertura"
					value="<fmt:formatDate value='${processoSeletivo.dataDeAbertura}' type='date' pattern="dd/MM/yyyy"/>" />
				</span>

				<div class="label">
					<fmt:message key="data_fechamento_insercao" />
				</div>

				<span class="formw"> <input class="data" type="text"
					style="width: 85px" name="processoSeletivo.dataLimiteDeInscricao"
					value="<fmt:formatDate value='${processoSeletivo.dataLimiteDeInscricao}' type='date' pattern="dd/MM/yyyy"/>" />
				</span>

				<div class="label">
					<fmt:message key="processo_seletivo_tipo" />
					<font color="red">*</font>
				</div>
				<span class="formw"> <select
					name="processoSeletivo.tipoProcessoSeletivo" id="selectMultiple">
						<c:forEach var="tipo" items="${tipos}">
							<c:choose>
								<c:when test="${tipo == processoSeletivo.tipoProcessoSeletivo}">
									<option value="${tipo}" selected="${tipo}">
										<fmt:message key="${tipo.msgKey}" />
									</option>
								</c:when>
								<c:otherwise>
									<option value="${tipo}">
										<fmt:message key="${tipo.msgKey}" />
									</option>
								</c:otherwise>
							</c:choose>
						</c:forEach>
				</select> </span>
			</div>
			<div class='row'>
				<input type="submit" value='<fmt:message key="salvar" />' />
			</div>
		</fieldset>
	</form>

	<div class="column" style="width: 100%">
		<div class="portlet">
			<div class="portlet-header">
				<fmt:message key="menu_processos_seletivos" />
			</div>

			<div class="tabelaDiv maior">
				<table class="tabela" cellpadding="5px" cellspacing="0"
					id="tableFormacao">

					<tr>
						<th><b><fmt:message key="processo_seletivo_descricao_TITLE" />
						</b>
						</th>
						<th><b><fmt:message key="processo_seletivo_tipo_TITLE" /> </b>
						</th>
						<th><b><fmt:message
									key="cadastro_curriculo_tabela_titulo_data_ingresso" /> </b>
						</th>
						<th><b><fmt:message
									key="cadastro_curriculo_tabela_titulo_data_termino" /> </b>
						</th>
					</tr>
					<c:forEach var="processoSeletivo"
						items="${processosSeletivos}" varStatus="rowCounter">
						<c:choose>
							<c:when test="${rowCounter.count % 2 == 0}">
								<c:set var="rowStyle" scope="page" value="odd" />
							</c:when>
							<c:otherwise>
								<c:set var="rowStyle" scope="page" value="even" />
							</c:otherwise>
						</c:choose>


						<tr class="${rowStyle}">
							<td>${processoSeletivo.descricao}</td>
							<td>${processoSeletivo.tipoProcessoSeletivo}</td>
							<td><fmt:formatDate
									value="${processoSeletivo.dataDeAbertura}" pattern="dd/MM/yyyy" />
							</td>
							<td><fmt:formatDate
									value="${processoSeletivo.dataLimiteDeInscricao}"
									pattern="dd/MM/yyyy" />
							</td>
							<td><a
								href="<c:url value='/processoSeletivo/editar/${processoSeletivo.processoSeletivoId}'/>">
									<img src="<c:url value='/images/editar.png'/>"
									alt='<fmt:message key="editar"/>'
									title="<fmt:message key="editar"/>" /> </a>
							<td>
							<td><a
								href="<c:url value='/processoSeletivo/remover/${processoSeletivo.processoSeletivoId}'/>">
									<img src="<c:url value='/images/excluir.gif'/>"
									alt='<fmt:message key="excluir"/>'
									title="<fmt:message key="excluir"/>" 
									onclick="return confirm('<fmt:message
										key="tem_certeza_excluir" />');"/> </a>
							<td>
						</tr>
					</c:forEach>
				</table>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>


<%@ include file="../rodape.jsp"%>